cmake_minimum_required(VERSION 3.15)

# set CQUPT_DIR to the path where CQUPT is located here
set(CQUPT_DIR "D:/projects/compact-quick-unified-protocol-for-transfer")

# 设置 CQUPT 库的路径
set(CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}/..")

# 查找 CQUPT 包
find_package(CQUPT REQUIRED)

# 创建客户端可执行文件
add_executable(CQUPT_Example_Client
        cqupt_example_client.c
)

# 链接 CQUPT 库到客户端
target_link_libraries(CQUPT_Example_Client 
    PRIVATE 
        CQUPT::CQUPT
)

# 创建服务器可执行文件
add_executable(CQUPT_Example_Server
        cqupt_example_server.c
)

# 链接 CQUPT 库到服务器
target_link_libraries(CQUPT_Example_Server 
    PRIVATE 
        CQUPT::CQUPT
)
